<%-- 
    Document   : sphot
    Created on : Oct 7, 2011, 3:27:01 PM
    Author     : Rocker000
--%>

<%@page import="dao.LoaiSanPham_dao"%>
<%@page import="pojo.LoaiSanPham_pojo"%>
<%@page import="dao.SanPham_dao"%>
<%@page import="pojo.SanPham_pojo"%>
<%@page import="java.util.ArrayList"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<center><h4><font color="#FF0000">SẢN PHẨM ĐƯỢC MUA NHIỀU NHẤT</font></h4></center>
<%ArrayList<SanPham_pojo> ds = SanPham_dao.LaySanPhamHot();%>
<table width="100%" border="0" background="Image/main.gif">
    <%for(int i=0;i<ds.size();i=i+4){ %>

  <tr align="center">
      <%for(int j =i;j<=i+3;j++){if(j<ds.size()){SanPham_pojo sp = ds.get(j); %>
    
    <td>
        <table width="100%" border="1">
            <tr>
                <td>
                    <table width="100%" border="0" >
          <tr>
              <td align="center"><img src="<%=sp.getImage() %>" width="150" height="150" alt="" /></td>
          </tr>
          <tr>
              <td align="center"><Strong><font color="green"><%=sp.getTenSanPham() %></font></strong></td>
          </tr>
          <tr>
              <td align="center">Giá:<font color="red"><strong><%=sp.getGia() %> K</strong></font></td>
          </tr>
          <tr>
              <td align="center"><a href="chitietsanpham.jsp?masanpham=<%=sp.getMaSanPham() %>&&madanhmuc=">Xem Chi Tiết</a></td>
          </tr>
        </table>
                </td>
            </tr>
        </table>
        
    </td>
    <%}}%>
    
  </tr>
 <%}%>
</table>
